﻿using ET.DBCommon.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ET.DBCommon.DAL
{
    public class RoleDAL
    {
        public static List<RoleModel> GetRoleList()
        {
            string sql = "SELECT * FROM post";
            DataSet ds = DbHelper.ExecuteDataset(sql);
            List<RoleModel> lst = new List<RoleModel>();
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    RoleModel info = new RoleModel();
                    info.RoleName = dt.Rows[i]["post_name"].ToString();
                    info.Remark = dt.Rows[i]["remark"].ToString();
                    info.Id =dt.Rows[i]["post_id"].ToString();
                    lst.Add(info);
                }
            }
            return lst;
        }
    }
}
